package mpc;

public class PointerQueue implements IQueue {
	
	private QE head = null, tail = null;
	
	@Override
	public void add(XYPair u) {
		QE n = new QE();
		n.value = u;
		if(tail != null) tail.next = n;
		tail = n;
		
		if(head == null) head = n;
	}

	@Override
	public XYPair delete() {
		QE r = head;
		head = head.next;
		return r.value;
	}

	@Override
	public boolean isEmpty() {
		return head == null;
	}

	@Override
	public boolean isFull() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public XYPair first() {
		// TODO Auto-generated method stub
		return head.value;
	}

}

class QE{
	XYPair value;
	QE next;
}